#include "wdt.h"
#include "LPC17xx.h"

uint32_t WDTInit( void )
{
  //NVIC_EnableIRQ(WDT_IRQn);

  LPC_WDT->WDTC = WDT_FEED_VALUE;	/* once WDEN is set, the WDT will start after feeding */
  LPC_WDT->WDMOD = WDEN;
  LPC_WDT->WDMOD |= WDRESET;

  LPC_WDT->WDFEED = 0xAA;	/* Feeding sequence */
  LPC_WDT->WDFEED = 0x55;
  return 1;
}

void WDTFeed( void )
{
  LPC_WDT->WDFEED = 0xAA;	/* Feeding sequence */
  LPC_WDT->WDFEED = 0x55;
  return;
}

